﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace FormBase
{
    public partial class FPGM0120 : Form
    {
        public FPGM0120()
        {
            InitializeComponent();
        }

        private void btnSearch_Click(object sender, EventArgs e)
        {
            string sStreet = txtStreet.Text;
            string sCity = txtCity.Text;
            string sState = txtState.Text;
            string sZip = txtZip.Text;

            try
            {
                StringBuilder sb1 = new StringBuilder();
                sb1.Append("http://maps.google.com/maps?q=");

                if (sStreet.Length > 0)
                {
                    sb1.Append(sStreet + "," + "+");
                }
                if (sCity.Length > 0)
                {
                    sb1.Append(sCity + "," + "+");
                }
                if (sState.Length > 0)
                {
                    sb1.Append(sState + "," + "+");
                }
                if (sZip.Length > 0)
                {
                    sb1.Append(sZip + "," + "+");
                }
                webBrowser1.Navigate(sb1.ToString());
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString());
            }
        }
    }
}
